﻿
using Microsoft.Extensions.Configuration;
using System.IO;

namespace Common
{
    public class ConfigHelp
    {
        /// <summary>
        /// 获取配置信息集合
        /// </summary>
        /// <param name="strPath">配置信息路径</param>
        /// <returns></returns>
        public static IConfigurationRoot GetConfigurationRoot(string ConfigFileName)
        {
            var builder = new ConfigurationBuilder().SetBasePath(Path.GetDirectoryName(ConfigFileName)).AddJsonFile(ConfigFileName);
            return builder.Build();
        }
    }
}
